/* eslint-disable no-sequences */
!(function (e) {
  var t = {};
  function n(r) {
    if (t[r]) return t[r].exports;
    var o = (t[r] = { i: r, l: !1, exports: {} });
    return e[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports;
  }
  (n.m = e),
    (n.c = t),
    (n.d = function (e, t, r) {
      n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r });
    }),
    (n.r = function (e) {
      'undefined' !== typeof Symbol &&
        Symbol.toStringTag &&
        Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
        Object.defineProperty(e, '__esModule', { value: !0 });
    }),
    (n.t = function (e, t) {
      if ((1 & t && (e = n(e)), 8 & t)) return e;
      if (4 & t && 'object' === typeof e && e && e.__esModule) return e;
      var r = Object.create(null);
      if (
        (n.r(r),
        Object.defineProperty(r, 'default', { enumerable: !0, value: e }),
        2 & t && 'string' !== typeof e)
      )
        for (var o in e)
          n.d(
            r,
            o,
            function (t) {
              return e[t];
            }.bind(null, o),
          );
      return r;
    }),
    (n.n = function (e) {
      var t =
        e && e.__esModule
          ? function () {
              return e.default;
            }
          : function () {
              return e;
            };
      return n.d(t, 'a', t), t;
    }),
    (n.o = function (e, t) {
      return Object.prototype.hasOwnProperty.call(e, t);
    }),
    (n.p = ''),
    n((n.s = 2085));
})({
  2085: function (e, t) {
    var n = function (e, t) {
        var n = e.match(new RegExp('[?&]'.concat(t, '=([^&]+)')));
        return n ? n[1] : null;
      },
      r = !1;
    window.DTFrameLogin = function (e, t, o, c) {
      // try {
      //   if (r) return;
      // } catch (e) {}
      var i,
        a = (e.id && document.getElementById(e.id)) || null,
        u = document.createElement('iframe');
      t.client_id && t.redirect_uri && t.response_type && t.scope
        ? a
          ? ((a.innerHTML = ''),
            a.appendChild(u),
            u &&
            u.contentWindow &&
            u.contentWindow.postMessage &&
            window.addEventListener
              ? ((u.src = 'https://'
                  .concat(
                    (i = t).isPre ? 'pre-login' : 'login',
                    '.dingtalk.com/oauth2/auth?iframe=true&redirect_uri=',
                  )
                  .concat(i.redirect_uri, '&response_type=')
                  .concat(i.response_type, '&client_id=')
                  .concat(i.client_id, '&scope=')
                  .concat(i.scope)
                  .concat(i.prompt ? '&prompt='.concat(i.prompt) : '')
                  .concat(i.state ? '&state='.concat(i.state) : '')
                  .concat(i.org_type ? '&org_type='.concat(i.org_type) : '')
                  .concat(i.corpId ? '&corpId='.concat(i.corpId) : '')
                  .concat(
                    i.exclusiveLogin
                      ? '&exclusiveLogin='.concat(i.exclusiveLogin)
                      : '',
                  )
                  .concat(
                    i.exclusiveCorpId
                      ? '&exclusiveCorpId='.concat(i.exclusiveCorpId)
                      : '',
                  )),
                (u.width = ''.concat(e.width || 300)),
                (u.height = ''.concat(e.height || 300)),
                (u.frameBorder = '0'),
                (u.scrolling = 'no'),
                (u.name = 'dingtalk-login_iframe-scan'),
                (r = !0),
                window.addEventListener('message', function (e) {
                  var t = e.data,
                    r = e.origin;
                  if (/login\.dingtalk\.com/.test(r) && t)
                    if (t.success && t.redirectUrl) {
                      var i = t.redirectUrl,
                        a = n(i, 'authCode') || '',
                        u = n(i, 'state') || '',
                        d = n(i, 'error') || '';
                      a
                        ? o && o({ redirectUrl: i, authCode: a, state: u })
                        : c && c(d);
                    } else c && c(t.errorMsg);
                }))
              : c && c('Browser not support'))
          : c && c('Element not found')
        : c && c('Missing parameters');
    };
  },
});
